package com.reps.service;


import java.io.File;

/**
 * @author chl
 * @date 2018/7/16 8:58
 */
public class Test {

    //开始抓取用户下标，从0开始
    private   static Integer start=0;
    //总人数
    private   static Integer length=376;
    /**
     * 请求端口
     */
    public    static String port="10013";

    public static String name="140221105000";
    
    public static String jssesionid="1hm8pd3nzt7s4";
    public static String winid="dx_1646_";

    public static String filePath="F:"+ File.separator+"阳高县"+File.separator+"东小村镇"+File.separator+"神泉寺卫生室.txt";
    public synchronized static Integer getNext()
    {
        if(start<length)
        return start++;
        else
            return null;
    }

    public static void main(String[] args) throws Exception
    {



        for(Integer i=0;i<10;i++)
        {
            synchronized (i)
            {
                int next=getNext();
                DowloadThread thread=new DowloadThread(next,next+1,"线程"+i);
                thread.start();
                Thread.sleep(5000);
            }


        }

    }









}
